<% include ../pageHeader %>

<div id="mainWrapper">
    <div id="content" class="content">
        <div id="innerContent">
            <div class="textbox">
                <div class="textbox-title"><h4><%= __('user_group') %></h4></div>
                <div class="textbox-content">
                        <form method="post" action="?in=group">
                    <table border="0" cellpadding="3" cellspacing="2">
                            <tr>
                                <td class="listbox-header"></td>
                                <td class="listbox-header"></td>
                                <td class="listbox-header"><%= __('view') %></td>
                                <td class="listbox-header"><%= __('post') %></td>
                                <td class="listbox-header"><%= __('edit') %></td>
                                <td class="listbox-header"><%= __('delete') %></td>
                                <td class="listbox-header"><%= __('upload') %></td>
                            </tr>
                            <% for(var i = 0;i < theCache.userGroup.length;i++){
                                    with(theCache.userGroup[i]){ %>
                                <tr>
                                    <td>
                                        <% if(id > 4){ %>
                                            <input type="checkbox" name="selected" value="<%= id %>"/>
                                        <% }else{ %>
                                            <input type="checkbox" name="not_for_select" disabled="disabled"/>
                                        <% } %>
                                        <input type="hidden" name="id" value="<%= id %>"/>
                                    </td>
                                    <td>
                                        <input type="text" name="name" size="10" maxlength="50"
                                               value="<%= helper.HTMLEncodeLite(name) %>" class="text"/>
                                    </td>
                                    <td>
                                        <select name="view">
                                            <option value="0"
                                                    <% if(rights["view"] == 0) { %>  selected="selected" <% } %>
                                            ><%= __('none') %></option>
                                            <option value="1"
                                                    <% if(rights["view"] == 1) { %>  selected="selected" <% } %>
                                            ><%= __('normal') %></option>
                                            <option value="2"
                                                    <% if(rights["view"] == 2) { %>  selected="selected" <% } %>
                                            ><%= __('hidden') %></option>
                                            <option value="3"
                                                    <% if(rights["view"] == 3 || id == 1) { %>  selected="selected" <% } %>
                                            ><%= __('private') %></option>
                                        </select>
                                    </td>
                                    <td>
                                        <select name="post">
                                            <option value="0"
                                                    <% if(rights["post"] == 0) { %>  selected="selected" <% } %>
                                            ><%= __('none') %></option>
                                            <option value="1"
                                                    <% if(rights["post"] == 1) { %>  selected="selected" <% } %>
                                            ><%= __('comments') %></option>
                                            <option value="2"
                                                    <% if(rights["post"] == 2 || id == 1) { %> selected="selected" <% } %>
                                            ><%= __('articles') %></option>
                                        </select>
                                    </td>
                                    <td>
                                        <select name="edit">
                                            <option value="0"
                                                    <% if(rights["edit"] == 0) { %> selected="selected" <% } %>
                                            ><%= __('none') %></option>
                                            <option value="1"
                                                    <% if(rights["edit"] == 1) { %> selected="selected" <% } %>
                                            ><%= __('self') %></option>
                                            <option value="2"
                                                    <% if(rights["edit"] == 2 || id == 1) { %> selected="selected" <% } %>
                                            ><%= __('all') %></option>
                                        </select>
                                    </td>
                                    <td>
                                        <select name="delete">
                                            <option value="0"
                                                    <% if(rights["delete"] == 0) { %> selected="selected" <% } %>
                                            ><%= __('none') %></option>
                                            <option value="1"
                                                    <% if(rights["delete"] == 1) { %> selected="selected" <% } %>
                                            ><%= __('self') %></option>
                                            <option value="2"
                                                    <% if(rights["delete"] == 2 || id == 1) { %> selected="selected" <% } %>
                                            ><%= __('all') %></option>
                                        </select>
                                    </td>
                                    <td>
                                        <select name="upload">
                                            <option value="0"
                                                    <% if(rights["upload"] == 0) { %> selected="selected" <% } %>
                                            ><%= __('disabled') %></option>
                                            <option value="1"
                                                    <% if(rights["upload"] == 1 || id == 1) { %> selected="selected" <% } %>
                                            ><%= __('enabled') %></option>
                                        </select>
                                    </td>
                                </tr>
                            <% }
                            }
                            %>
                            <tr>
                                <td><%= __('new') %>:</td>
                                <td><input type="hidden" name="id" value="0"/> <input type="text" name="name" size="10"
                                                                                      maxlength="50" value=""
                                                                                      class="text"/></td>
                                <td>
                                    <select name="view">
                                        <option value="0"><%= __('none') %></option>
                                        <option value="1"><%= __('normal') %></option>
                                        <option value="2"><%= __('hidden') %></option>
                                        <option value="3"><%= __('private') %></option>
                                    </select>
                                </td>
                                <td>
                                    <select name="post">
                                        <option value="0"><%= __('none') %></option>
                                        <option value="1"><%= __('comments') %></option>
                                        <option value="2"><%= __('articles') %></option>
                                    </select>
                                </td>
                                <td>
                                    <select name="edit">
                                        <option value="0"><%= __('none') %></option>
                                        <option value="1"><%= __('self') %></option>
                                        <option value="2"><%= __('all') %></option>
                                    </select>
                                </td>
                                <td>
                                    <select name="delete">
                                        <option value="0"><%= __('none') %></option>
                                        <option value="1"><%= __('self') %></option>
                                        <option value="2"><%= __('all') %></option>
                                    </select>
                                <td>
                                    <select name="upload">
                                        <option value="0"><%= __('disabled') %></option>
                                        <option value="1"><%= __('enabled') %></option>
                                    </select>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <br/>
                                    <select name="act">
                                        <option value="update"><%= __('save_change') %></option>
                                        <option value="delete"><%= __('delete_group') %></option>
                                    </select>
                                    <input type="submit" name="submit" value=" <%= __('execute') %> " class="button"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6"><span class="red">* <%= __('delete_group_note') %></span></td>
                            </tr>
                    </table>
                        </form>
                </div>
            </div>
        </div>
    </div>
    <% include adminSidebar %>
    <div class="clear"></div>
</div>
<% include ../pageFooter %>
